#ifndef QQ_ICON_BUTTON
#define QQ_ICON_BUTTON

#include <qevent.h>
#include <qfont.h>
#include <qpainter.h>
#include <qpainterpath.h>
#include <qpropertyanimation.h>
#include <qpushbutton.h>


#include "widget/QQIconButtonPrivate.h"

class QQIconButtonPrivate;

class QQIconButton : public QPushButton
{
	Q_OBJECT
		Q_Q_CREATE(QQIconButton)
public:
	void setBorderRadius(int BorderRadius);
	int getBorderRadius() const;

	void setOpacity(qreal Opacity);
	qreal getOpacity() const;

	void setNormalColor(QColor NormalColor);
	QColor getNormalColor() const;

	void setHoverColor(QColor HoverColor);
	QColor getHoverColor() const;

	void setPressColor(QColor PressColor);
	QColor getPressColor() const;

	void setSelectedColor(QColor SelectedColor);
	QColor getSelectedColor() const;

	void setNormalIconColor(QColor NormalIconColor);
	QColor getNormalIconColor() const;

	void setHoverIconColor(QColor HoverIconColor);
	QColor getHoverIconColor() const;

	void setPressIconColor(QColor PressIconColor);
	QColor getPressIconColor() const;

	void setSelectedIconColor(QColor SelectedIconColor);
	QColor getSelectedIconColor() const;

	void setIsSelected(bool IsSelected);
	bool getIsSelected() const;

signals:
	void pBorderRadiusChanged();
	void pOpacityChanged();
	void pNormalColorChanged();
	void pHoverColorChanged();
	void pPressColorChanged();
	void pSelectedColorChanged();
	void pNormalIconColorChanged();
	void pHoverIconColorChanged();
	void pPressIconColorChanged();
	void pSelectedIconColorChanged();
	void pIsSelectedChanged();

public:
	QQIconButton(QPixmap pix, QWidget* parent = nullptr);
	QQIconButton(ElaIconType::IconName awesome, QWidget* parent = nullptr);
	QQIconButton(ElaIconType::IconName awesome, int pixelSize, QWidget* parent = nullptr);
	QQIconButton(ElaIconType::IconName awesome, int pixelSize, int fixedWidth, int fixedHeight, QWidget* parent = nullptr);
	~QQIconButton();
	void setAwesome(ElaIconType::IconName awesome);
	ElaIconType::IconName getAwesome() const;

	void setPixmap(QPixmap pix);

protected:
	virtual bool event(QEvent* event) override;
	virtual void paintEvent(QPaintEvent* event) override;
};

#endif // !QQ_ICON_BUTTON

